From b75d0e8f3866e3e9e7ab951c74115a55c7f4d90d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 18 Oct 2001 20:15:53 +0000 Subject: [PATCH] Don't restrict the width of the spinbutton entry field to 10 digits. * gtk/gtkspinbutton.c (gtk_spin_button_size_request): Don't restrict the width of the spinbutton entry field to 10 digits. (#58681) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkspinbutton.c | 7 +++++-- 8 files changed, 47 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82a1ed5b59..fe7ce65187 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-10-18 Matthias Clasen + + * gtk/gtkspinbutton.c (gtk_spin_button_size_request): + Don't restrict the width of the spinbutton entry field + to 10 digits. (#58681) + Thu Oct 18 14:58:14 2001 Jonathan Blandford * tests/testtreeflow.c: new test program for the tree. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 82a1ed5b59..fe7ce65187 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +2001-10-18 Matthias Clasen + + * gtk/gtkspinbutton.c (gtk_spin_button_size_request): + Don't restrict the width of the spinbutton entry field + to 10 digits. (#58681) + Thu Oct 18 14:58:14 2001 Jonathan Blandford * tests/testtreeflow.c: new test program for the tree. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 82a1ed5b59..fe7ce65187 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2001-10-18 Matthias Clasen + + * gtk/gtkspinbutton.c (gtk_spin_button_size_request): + Don't restrict the width of the spinbutton entry field + to 10 digits. (#58681) + Thu Oct 18 14:58:14 2001 Jonathan Blandford * tests/testtreeflow.c: new test program for the tree. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 82a1ed5b59..fe7ce65187 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +2001-10-18 Matthias Clasen + + * gtk/gtkspinbutton.c (gtk_spin_button_size_request): + Don't restrict the width of the spinbutton entry field + to 10 digits. (#58681) + Thu Oct 18 14:58:14 2001 Jonathan Blandford * tests/testtreeflow.c: new test program for the tree. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 82a1ed5b59..fe7ce65187 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +2001-10-18 Matthias Clasen + + * gtk/gtkspinbutton.c (gtk_spin_button_size_request): + Don't restrict the width of the spinbutton entry field + to 10 digits. (#58681) + Thu Oct 18 14:58:14 2001 Jonathan Blandford * tests/testtreeflow.c: new test program for the tree. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 82a1ed5b59..fe7ce65187 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2001-10-18 Matthias Clasen + + * gtk/gtkspinbutton.c (gtk_spin_button_size_request): + Don't restrict the width of the spinbutton entry field + to 10 digits. (#58681) + Thu Oct 18 14:58:14 2001 Jonathan Blandford * tests/testtreeflow.c: new test program for the tree. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 82a1ed5b59..fe7ce65187 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2001-10-18 Matthias Clasen + + * gtk/gtkspinbutton.c (gtk_spin_button_size_request): + Don't restrict the width of the spinbutton entry field + to 10 digits. (#58681) + Thu Oct 18 14:58:14 2001 Jonathan Blandford * tests/testtreeflow.c: new test program for the tree. diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index a767d88994..7be68ce10f 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -583,6 +583,7 @@ gtk_spin_button_size_request (GtkWidget *widget, gint width; gint w; gint string_len; + gint max_string_len; gint digit_width; context = gtk_widget_get_pango_context (widget); @@ -598,14 +599,16 @@ gtk_spin_button_size_request (GtkWidget *widget, /* Get max of MIN_SPIN_BUTTON_WIDTH, size of upper, size of lower */ width = MIN_SPIN_BUTTON_WIDTH; + max_string_len = MAX (10, compute_double_length (1e9 * spin_button->adjustment->step_increment, + spin_button->digits)); string_len = compute_double_length (spin_button->adjustment->upper, spin_button->digits); - w = MIN (string_len, 10) * digit_width; + w = MIN (string_len, max_string_len) * digit_width; width = MAX (width, w); string_len = compute_double_length (spin_button->adjustment->lower, spin_button->digits); - w = MIN (string_len, 10) * digit_width; + w = MIN (string_len, max_string_len) * digit_width; width = MAX (width, w); requisition->width = width + ARROW_SIZE + 2 * widget->style->xthickness; -- 2.30.2